package com.jeesite.modules.dataScreen.web.dto;

import com.jeesite.modules.dataScreen.constants.ValidationGroup;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.groups.Default;

@Data
public class SysUserDto {

    @NotNull(message = "用户ID为空", groups = {ValidationGroup.UPDATE.class})
    @ApiModelProperty("用户ID")
    private Integer id;
    @NotBlank(message = "用户名为空", groups = {ValidationGroup.CREATE.class})
    @ApiModelProperty("用户名")
    @Length(min = 2,max = 20,groups = {ValidationGroup.CREATE.class})
    private String name;
    @NotBlank(message = "密码为空", groups = {ValidationGroup.CREATE.class})
    @Length(min = 2,max = 20,groups = {Default.class})
    @ApiModelProperty("密码")
    private String password;
    @NotNull(message = "角色为空", groups = {Default.class})
    private Integer roleId;

    private String remark;
}
